<?php
if(!defined('IN_IBEIKE')) {
	exit('Access Denied');
}
class table_city_offical extends common_table{
	public function __construct(){
		$this->_table='city_offical';
		$this->_pk='oid';
		parent::__construct();
	}
	public function add_offical($offical_data,$main_data, $return_insert_id = false){
		if($main_data && is_array($main_data) && $offical_data &&is_array($offical_data)){
			if(C::t('city_thread')->add_thread($main_data)){
				return DB::insert($this->_table, $offical_data, $return_insert_id = false);
			}else{
				return 0;
			}
		}
		return 0;
	}
	public function del_offical($offical_id){
		if($offical_id){
			if(C::t('city_thread')->del_thread("tid=".$offical_id)){
				return DB::delete($this->table,"tid=".$offical_id);
			}
		}
	}
	public function del_offical_by_authorid($authorid){
		
	}
	public function del_offical_by_dateline($dateline){
		
	}
	public function fetch_all_by_oid($oid){
		if(!empty($oid)&&$oid){
			return DB::fetch_all('SELECT * FROM %t WHERE oid=%s',array($this->_table,$oid));//返回数组包含各个字段的值
		}
		return false;
	}
	
}
?>